//
//  AllDetail.m
//  MoGuRadio
//
//  Created by dlios on 15/6/13.
//  Copyright (c) 2015年 mogu.com 蘑菇科技. All rights reserved.
//

#import "AllDetail.h"

@implementation AllDetail

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
    if ([key isEqualToString:@"host"]) {
        
        self.name = [[value firstObject] objectForKey:@"name"];
        
    } else if ([key isEqualToString:@"audioList"]) {
        
        self.albumId = [[[[value firstObject] objectForKey:@"audioInfo"] objectForKey:@"albumId"] description];
        
        self.mp3PlayUrl = [[[value firstObject] objectForKey:@"audioInfo"] objectForKey:@"mp3PlayUrl"];
        
        self.orderNum = [[[[value firstObject] objectForKey:@"audioInfo"] objectForKey:@"orderNum"] description];
        
        self.audioDes = [[[value firstObject] objectForKey:@"audioInfo"] objectForKey:@"audioDes"];
        
        self.audioName = [[[value firstObject] objectForKey:@"audioInfo"] objectForKey:@"audioName"];
        
        self.likedNum = [[[[value firstObject] objectForKey:@"audioInfo"] objectForKey:@"likedNum"] description];
        
        self.albumPic = [[[value firstObject] objectForKey:@"audioInfo"] objectForKey:@"albumPic"];
    }
    
}

+ (NSMutableArray *)getModelArrWithDics:(NSMutableArray *)dicArr
{
    NSMutableArray *arr = [NSMutableArray array];
    for (NSDictionary *dic in dicArr) {
        AllDetail *all = [[AllDetail alloc] init];
        [all setValuesForKeysWithDictionary:dic];
        [arr addObject:all];
        [all release];
    }
    return arr;
}


- (void)dealloc
{
    [_likedNum release];
    [_audioName release];
    [_audioDes release];
    [_rid release];
    [_rname release];
    [_pic release];
    [_updateTime release];
    [_followedNum release];
    [_listenNum release];
    [_shareUrl release];
    [_name release];
    [_radioDesc release];
    [_albumId release];
    [_mp3PlayUrl release];
    [_orderNum release];
    [_albumPic release];
    [super dealloc];
}

@end
